

<template>
<div>
  <div :class="activeObj">样式绑定</div>
</div>
</template>
<script setup lang="ts">

import { computed, ref } from 'vue'
const isActive = ref(true)
const hasError = ref(true)
const activeObj = computed(()=>{
  return {
    active: isActive.value,
    'text-danger': hasError.value
  }
})
</script>
<style scoped>
.active {
  background: #e3e3d3;
}
.text-danger {
  color: #f32;
}
</style>
